<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>农产品信息</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css">
  <link rel="stylesheet" href="../../../style/wangeditor.css">
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加农产品信息':action=='Modify'?'修改农产品信息':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'agricultural_supplies_store_goods', 'form': 'dataForm' ,'primary_key':'Agricultural_Supplies_Store_Goods_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">农产品信息</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">农产品名称</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请选择农产品名称', trigger: 'change' }]" prop="Goods_Name">
                <el-input v-model="dataForm.Goods_Name" class="borderless-input" placeholder="请输入农产品名称" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">农产品图片</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请选择农产品图片', trigger: 'change' }]" prop="Picture_URL">
                <yl-upload v-model="dataForm.Picture_URL"></yl-upload>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">农产品类型</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请选择农产品类型', trigger: 'change' }]"
                prop="Agricultural_Supplies_Store_Goods_Type_SerialNumber">
                <el-select clearable v-model.trim="dataForm.Agricultural_Supplies_Store_Goods_Type_SerialNumber"
                  placeholder="请选择农产品类型" filterable style="width: 100%">
                  <el-option v-for="(item,index) in category" :key="index"
                    :label="item.Agricultural_Supplies_Store_Goods_Type_Name"
                    :value="item.Agricultural_Supplies_Store_Goods_Type_SerialNumber"></el-option>
                </el-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">详情</div>
              </template>
              <el-input type="textarea" :autosize="{ minRows: 2}" v-model="dataForm.Notes" class="borderless-input"
                placeholder="请输入详情" />
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">介绍视频</div>
              </template>
              <yl-upload accept=".mp4,.mov,.avi" :before-upload="beforeUpload" drag v-model="dataForm.video_URL">
                <!-- <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
  <div class="el-upload__tip" slot="tip">只能上传.mp4,.mov,.avi文件，且不超过20Mb</div> -->

              </yl-upload>

              

            </el-descriptions-item>

          </el-descriptions>
        </el-form>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">图</div>
            <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
            </div>
          </div>
          <el-form :model="{childDataForm:childDataForm.filter(i => i.Row_Status != '1')}" ref="form2"
            :inline-message="true" style="width: 100%">
            <el-descriptions :column="3" size="large" border
              :data-options="JSON.stringify({ 'TableName': 'agricultural_supplies_store_goods_image', 'form': 'childDataForm', 'ParentTableName': 'agricultural_supplies_store_goods'})"
              v-for="(item,index) in childDataForm.filter(i => i.Row_Status != '1')" :key="index">
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">图片</div>
                </template>
                <el-form-item :rules="[{ required: true, message: '请上传图片', trigger: 'change' }]">
                  <yl-upload v-model="item.Image_URL"></yl-upload>
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">图片类型</div>
                </template>
                <el-form-item :prop="'childDataForm.' + index  + '.Image_Type'"
                  :rules="[{ required: true, message: '请选择图片类型', trigger: 'change' }]">
                  <el-select clearable v-model.trim="item.Image_Type" placeholder="请选择图片类型" filterable
                    style="width: 100%">
                    <el-option :label="item.Image_Category" :value="item.Image_Category_SerialNumber"
                      v-for="(item,index) in image_category" :key="index"></el-option>
                  </el-select>
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-form>
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>